using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class gal_paymentMap : EntityTypeConfiguration<gal_payment>
    {
        public gal_paymentMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.SectionString)
                .HasMaxLength(500);

            this.Property(t => t.SECTION_LABEL)
                .IsFixedLength()
                .HasMaxLength(3);

            this.Property(t => t.FORM_OF_PAYMENT_TYPE)
                .IsFixedLength()
                .HasMaxLength(2);

            this.Property(t => t.PARTY_AMOUNT_ACTUALLY_COLLECTED_OR_REFUNDED)
                .IsFixedLength()
                .HasMaxLength(12);

            this.Property(t => t.REFUND_INDICATOR)
                .IsFixedLength()
                .HasMaxLength(1);

            this.Property(t => t.CREDIT_CARD_CODE)
                .IsFixedLength()
                .HasMaxLength(2);

            this.Property(t => t.CREDIT_CARD_NUMBER)
                .IsFixedLength()
                .HasMaxLength(20);

            this.Property(t => t.CREDIT_CARD_EXPIRATION_DATE)
                .IsFixedLength()
                .HasMaxLength(4);

            this.Property(t => t.BLANK)
                .IsFixedLength()
                .HasMaxLength(1);

            this.Property(t => t.APPROVAL_CODE_INDICATOR)
                .IsFixedLength()
                .HasMaxLength(1);

            this.Property(t => t.ACTUAL_CREDIT_CARD_APPROVAL_CODE)
                .IsFixedLength()
                .HasMaxLength(6);

            this.Property(t => t.PAYMENT_PLAN_OPTIONS)
                .IsFixedLength()
                .HasMaxLength(3);

            // Table & Column Mappings
            this.ToTable("gal_payment");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.reference).HasColumnName("reference");
            this.Property(t => t.SectionString).HasColumnName("SectionString");
            this.Property(t => t.MIR).HasColumnName("MIR");
            this.Property(t => t.SECTION_LABEL).HasColumnName("SECTION LABEL");
            this.Property(t => t.FORM_OF_PAYMENT_TYPE).HasColumnName("FORM OF PAYMENT TYPE");
            this.Property(t => t.PARTY_AMOUNT_ACTUALLY_COLLECTED_OR_REFUNDED).HasColumnName("PARTY AMOUNT ACTUALLY COLLECTED OR REFUNDED");
            this.Property(t => t.REFUND_INDICATOR).HasColumnName("REFUND INDICATOR");
            this.Property(t => t.CREDIT_CARD_CODE).HasColumnName("CREDIT CARD CODE");
            this.Property(t => t.CREDIT_CARD_NUMBER).HasColumnName("CREDIT CARD NUMBER");
            this.Property(t => t.CREDIT_CARD_EXPIRATION_DATE).HasColumnName("CREDIT CARD EXPIRATION DATE");
            this.Property(t => t.BLANK).HasColumnName("BLANK");
            this.Property(t => t.APPROVAL_CODE_INDICATOR).HasColumnName("APPROVAL CODE INDICATOR");
            this.Property(t => t.ACTUAL_CREDIT_CARD_APPROVAL_CODE).HasColumnName("ACTUAL CREDIT CARD APPROVAL CODE");
            this.Property(t => t.PAYMENT_PLAN_OPTIONS).HasColumnName("PAYMENT PLAN OPTIONS");
        }
    }
}
